{template 'common/header'}

<title>会员中心</title>
<div class="mui-content content-bg-w7">
	<div class="header-user-center">
		<div class="info-left-block">
			<span class="info-vip-name">会员：{$member['commission']['levelname']}</span>
			<span class="info-vip-id">会员ID：{$member['id']}</span>
		</div>
		<div class="info-center-blick">
			<div class="picture-head-pic">
				<img src="{$member['avatar']}" alt="" />
			</div>
			<span class="info-user-name">{$member['nickname']}</span>
		</div>
		<div class="info-right-block">
			<a href="{php echo $this->createMobileUrl('member/info')}">
				<div class="btn-setup mui-icon mui-icon-gear"></div>
			</a>
		</div>
		<div class="info-fixed-block">
			<div class="info-sale-total">
				{php echo empty($commissionSet['texts']['orderprice'])?'销售额':$commissionSet['texts']['orderprice']} : {php echo round($orderStatistics['o_status_1']['cg_money_sum'] + $orderStatistics['o_status_2']['cg_money_sum'] + $orderStatistics['o_status_3']['cg_money_sum'] , 2)}元
			</div>
			<div class="info-award-total">
				{php echo empty($commissionSet['texts']['commission1'])?'我的奖励':$commissionSet['texts']['commission1']} : {$recordPrice['total']}元
			</div>
		</div>
	</div>
	<div class="main-content">
		{if $member['agentid'] != 0}
		<div class="tittle-recommend-name">您是由【{$superior['nickname']}】推荐</div>
		{else}
		<div class="tittle-recommend-name">您是由【{$set['shop']['name']}】推荐</div>
		{/if}
		<ul class="list-detail-block">
			<li id="d1" class="list-detail-item drawdown_menu">
				<span class="title-left">{$commissionSet['texts']['myteam']}</span>
				<span class="info-right-num">{php echo $teamLists['all']}人</span>
			</li>

			<li class="list-detail-item drawdownd1 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/myVip',array('level' => '1'))}"'>
				<span class="title-left">{php echo empty($commissionSet['texts']['myteam1'])?'一级下线':$commissionSet['texts']['myteam1']}</span>
				<span class="info-right-num">{php echo $teamLists[1]}人</span>
			</li>

			<li class="list-detail-item drawdownd1 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/myVip',array('level' => '2'))}"'>
				<span class="title-left">{php echo empty($commissionSet['texts']['myteam2'])?'二级下线':$commissionSet['texts']['myteam2']}</span>
				<span class="info-right-num">{php echo $teamLists[2]}人</span>
			</li>
			<li class="list-detail-item drawdownd1 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/myVip',array('level' => '3'))}"'>
					<span class="title-left">{php echo empty($commissionSet['texts']['myteam3'])?'三级下线':$commissionSet['texts']['myteam3']}</span>
					<span class="info-right-num">{php echo $teamLists[3]}人</span>
			</li>

			<li id="d2" class="list-detail-item drawdown_menu">
				<span class="title-left">{php echo empty($commissionSet['texts']['order'])?'分销订单':$commissionSet['texts']['order']}</span>
				<span class="info-right-num">{php echo $orderStatistics['o_status_0']['order_count'] + $orderStatistics['o_status_1']['order_count'] + $orderStatistics['o_status_2']['order_count'] + $orderStatistics['o_status_3']['order_count'] }单(￥{php echo round($orderStatistics['o_status_0']['cg_money_sum'] + $orderStatistics['o_status_1']['cg_money_sum'] + $orderStatistics['o_status_2']['cg_money_sum'] + $orderStatistics['o_status_3']['cg_money_sum'] , 2)})</span>
			</li>
			<li class="list-detail-item drawdownd2 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/orderx',array('status' => '0'))}"'>
				<span class="title-left">下单未付款</span>
				<span class="info-right-num">{$orderStatistics['o_status_0']['order_count']}(￥{php echo round($orderStatistics['o_status_0']['cg_money_sum'], 2)})</span>
			</li>
			<li class="list-detail-item drawdownd2 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/orderx',array('status' => '1'))}"'>
					<span class="title-left">下单已付款</span>
					<span class="info-right-num">{$orderStatistics['o_status_1']['order_count']}(￥{php echo round($orderStatistics['o_status_1']['cg_money_sum'], 2)})</span>
			</li>
			<li class="list-detail-item drawdownd2 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/orderx',array('status' => '2'))}"'>
					<span class="title-left">下单已发货</span>
					<span class="info-right-num">{$orderStatistics['o_status_2']['order_count']}(￥{php echo round($orderStatistics['o_status_2']['cg_money_sum'], 2)})</span>
			</li>
			<li class="list-detail-item drawdownd2 down" onclick='window.location.href="{php echo $this->createMobileUrl('member/orderx',array('status' => '3'))}"'>
					<span class="title-left">订单已完成</span>
					<span class="info-right-num">{$orderStatistics['o_status_3']['order_count']}(￥{php echo round($orderStatistics['o_status_3']['cg_money_sum'], 2)})</span>
			</li>
			<li id="d3" class="list-detail-item drawdown_menu">
				<span class="title-left">{php echo empty($commissionSet['texts']['commission1'])?'分销佣金':$commissionSet['texts']['commission1']}</span>
				<span class="info-right-num">{$recordPrice['total']}元</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">待结算业绩</span>
				<span class="info-right-num">{$recordPrice['lock']}</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">已提现业绩</span>
				<span class="info-right-num">{$recordPrice['pay']}</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">可提现业绩</span>
				<span class="info-right-num">{$recordPrice['ok']}</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">被驳回业绩</span>
				<span class="info-right-num">{$recordPrice['invalid']}</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">申请中业绩</span>
				<span class="info-right-num">{$recordPrice['apply']}</span>
			</li>
			<li class="list-detail-item drawdownd3 down">
				<span class="title-left">待打款业绩</span>
				<span class="info-right-num">{$recordPrice['check']}</span>
			</li>
			<li class="list-detail-item">
				<a class="title-left" href="{php echo $this->createMobileUrl('order/list')}">我的订单</a>
				<span class="btn-arrow-right"></span>
			</li>
			<li class="list-detail-item">
				<a class="title-left list-href-style" id="btnwithdraw">申请提现</a>
			</li>
			<li class="list-detail-item">
				<a  href="{php echo $this->createPluginMobileUrl('commission/log')}" class="title-left list-href-style">提现记录</a>
			</li>
			<li class="list-detail-item">
				<span class="title-left no-flex">我的余额</span>
				<a href="{php echo $this->createMobileUrl('member/recharge',array('openid'=>$openid))}" class="href-charge-style">充值</a>
				<span class="info-right-num" id="yue">{$member['credit2']}元</span>
			</li>
			{if isset($set['trade']) && $set['trade']['withdraw']==1}
			<li class="list-detail-item">
				<a class="title-left" id="btnwithdrawYue">余额提现</a>
				<span class="btn-arrow-right"></span>
			</li>
			{/if}
		</ul>
	</div>
</div>
<script language="javascript">
	$('.down').hide();
	$(function(){
		$('#d1').click(function(){
			$('.drawdownd1').toggle();
		})

		$('#d2').click(function(){
			$('.drawdownd2').toggle();
		})

		$('#d3').click(function(){
			$('.drawdownd3').toggle();
		})

		$('#btnwithdraw').click(function(){
			var mine = parseInt("{$recordPrice['ok']}");
			var withdraw = parseInt("{php echo $commissionSet['withdraw']}");
			if(mine > 0){
				if(mine < withdraw){
					mui.toast('提现申请请在每周一发起。');
					return false;
				}else{
					location.href = "{php echo $this->createPluginMobileUrl('commission/apply')}";
				}
			}else{
				mui.toast('很抱歉，没有可以提现的佣金');
			}
		});
		var withdrawmoney = {php echo empty($set['trade']['withdrawmoney'])?0:floatval($set['trade']['withdrawmoney'])};
		$('#btnwithdrawYue').click(function(){
			if($('#yue').html()<=0){
				mui.toast('无余额可提!');
				return;
			}
			if(withdrawmoney>0 && $('#yue').html()<withdrawmoney){
				mui.toast('满' +withdrawmoney + "元才能提现!" );
				return;
			}
			location.href = "{php echo $this->createMobileUrl('member/withdraw')}";
		});
	});
</script>
{php $show_footer=true;$footer_current ='second'}
{template 'common/footer'}